import type { Router } from 'vue-router';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';

export default (router: Router) => {
  router.beforeEach(_ => {
    NProgress.start();
  });

  router.afterEach(_ => {
    NProgress.done();
  });

  router.onError(_ => {
    NProgress.done();
  });
};
